//
//  HomeScene.swift
//  FirstGame
//
//  Created by Apple on 2017/12/21.
//  Copyright © 2017年 Apple. All rights reserved.
//

import SpriteKit

class HomeScene: GameScene {
    
    var btnRead: SKSpriteNode!
    
    override func sceneDidLoad() {
        super.sceneDidLoad()
        btnRead = childNode(withName: "buttonRead") as! SKSpriteNode
        
        btnHome?.isHidden = true
        btnPrevious?.isHidden = true
        btnNext?.isHidden = true
    }
    override func getNextScene() -> SKScene? {
        if btnRead.alpha < 0.8 { return nil }
        return SKScene(fileNamed: "Scene01")
    }
    
    override func touchDown(at point: CGPoint) {
        if let btn = self.btnRead, btn.contains(point) {
            goToNextScene()
        }
    }
}
